package res

import "regexp"

func IsValidUsername(Username string) bool {
	//用户名格式要求：4-20个字符，第一位必须字母，支持字母、数字组合
	var validUsername = `^[a-zA-Z][a-zA-Z0-9]{3,19}$`
	valid, _ := regexp.MatchString(validUsername, Username)
	return valid
}
func IsValidPassword(Password string) bool {
	var validUPassword = `^[a-zA-Z0-9]{8,16}$`
	valid, _ := regexp.MatchString(validUPassword, Password)
	return valid

}
func IsValidNane(name string) bool {
	var n = `^[\u4e00-\u9fa5]{2,4}$`
	valid, _ := regexp.MatchString(n, name)
	return valid
}
